<template>
  <div style="min-height: 500px" v-if="entity.zq !== 0">
    <PlanTongjiOnce v-if="state.PlanZq.once === entity.zq" :planId="props.planId"></PlanTongjiOnce>
    <PlanTongjiMonth v-if="state.PlanZq.month === entity.zq" :planId="props.planId"></PlanTongjiMonth>
    <PlanTongjiJidu v-if="state.PlanZq.jidu === entity.zq" :planId="props.planId"></PlanTongjiJidu>
  </div>
</template>

<script setup name="plantongji">
import request from '/@/utils/request';
import {reactive, ref, onMounted, onUnmounted, defineAsyncComponent, defineProps, nextTick} from "vue";
import PlanZq from "/@/utils/PlanZq";
const PlanTongjiOnce = defineAsyncComponent(() => import('/@/views/kucun/plan/plantongji_once.vue'));
const PlanTongjiMonth = defineAsyncComponent(() => import('/@/views/kucun/plan/plantongji_month.vue'));
const PlanTongjiJidu = defineAsyncComponent(() => import('/@/views/kucun/plan/plantongji_jidu.vue'));

let props = defineProps({
  planId : {type : Number, default: 0}
})
const state = reactive({
  PlanZq:PlanZq
})
let entity = ref({
  title:'',
  zq : 0,
})
const loadPlan = ()=>{
  request({ url: '/plan/getplanonly', data: {id : props.planId} }).then( res =>{
    entity.value = res.data
  })
}
onMounted(()=>{
  loadPlan();
})
</script>

<style scoped lang="scss">

</style>
